var tagPackage = Vue.component('tagPackage', {
    template: readComponentHTML("tagPackage"),
    data() {
        return {
            repositoryList:[],
            data:[]
        };
    },
    mounted() {
        this.init();
    },
    methods: {
        // 初始化 读取全局的标签集合
        init: function () {
            var that = this;
            that.openLoading();
            axios.get('/version/controll/tag/build/list')
                .then(function (response) {
                    if (response.data) {
                        that.repositoryList = response.data;
                    }
                    that.closeLoading();
                });
        },
        buildPackage(index, row) {
            var name = row.name;
            var projectMap = {
                "oa-gw-server" : "oa-gw",
                "oa-openapi" : "oa-openapi",
                "xxzx" : "oa-xxzx",
                "oa-basic" : "oa-basic",
                // "oa-sjhz" : "oa-zdgl",
                "oa-jadp" : "oa-jadp",
                "oa-sym" : "oa-sym",
                "oa-exchange" : "oa-exchange",
                "oa-jchy" : "oa-jchy",
                "oa-zdgl" : "oa-zdgl",
                "oa-bh" : "oa-bh",
                "oa-template" : "oa-template",
                "oa-wjk" : "oa-wjk",
                "oa-grsx" : "oa-grsx",
                "oa-public" : "oa-public",
                "oa-maintain" : "oa-maintain",
                "oa-workflow" : "oa-workflow",
            }
            if (!projectMap[name]) {
                this.$message.error("该模块未做jenkins项目映射，联系管理员添加")
                return;
            }
            window.open("http://172.16.99.11:8080/job/OAV2HNOA202012/view/oa-prod/job/xxtbg-oa-prod-folder/job/"
                + projectMap[name] +"/build?delay=0sec&buildId=123&project=" + name + "&tag=" + row.tag)
            window.open("http://172.16.99.11:8080/job/OAV2HNOA202012/view/oa-prod/job/cpjob/")
        }
    }
})